﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls.WebParts;
using System.Web;
using System.Security.Permissions;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint;

namespace BDF.TagCloud.Utilities
{
    [AttributeUsage(AttributeTargets.Property), AspNetHostingPermission(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal), AspNetHostingPermission(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
    public class LocalizedWebDescriptionAttribute: WebDescriptionAttribute
    {
        private String _description;
        public static new readonly WebDescriptionAttribute Default = new WebDescriptionAttribute();

        public LocalizedWebDescriptionAttribute() : this(String.Empty) { }

        public LocalizedWebDescriptionAttribute(String s)
        {
            this._description = SPUtility.GetLocalizedString("$Resources:" + s, "TagCloudFeature", SPContext.Current.Web.Language); 
        }

        public override String Description
        {
            get
            {
                return this.DescriptionValue;
            }
        }

        protected new String DescriptionValue
        {
            get { return this._description; }
            set { this._description = value; }
        }
    }
}
